<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>兑换码列表</title>
    <link rel="stylesheet" href="${base}/layui/css/layui.css">
    <link rel="stylesheet" href="${base}/awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="${base}/css/formSelects-v4.css">
    <link rel="stylesheet" href="${base}/css/admin.css">
    <style>
    	.layui-bg-black{        width: 200px;height: 136px;margin-right: 30px;float: left;text-align: center;font-size: 33px;color: #000000!important;padding-top: 30px;}
    	.hide {display: none;}
    	.checkbox{display: inline-block;}
    	.layui-form-item{font-size: 18px;}
    	.width100 {width: 100px; margin-right: 30px;float: left;}
    	.width180 {width: 180px; margin-right: 20px;float: left;}
    	.layui-input { display: inline-block; }
    </style>
</head>
<body class="layui-layout-body" style="overflow:scroll;">
<#include "/common/left.flt">	
<div class="layui-main" style="position: absolute;left: 204px;top: 60px; width: calc(100% - 210px);" >
	<table class="layui-table" >
		<thead>
	       <tr>
	       		<th>标题</th>
	            <th>图片</th>
	            <th>url</th>
	            <th>状态</th>
	            <th>操作</th>
	        </tr>
	     </thead>
	     <tbody>
	     <#list list as one>
	     <tr>
	     	<td>${one.title?default('')}</td>
	     	<td><img src="${one.pic?default('')}" /></td>
	     	<th>${one.url?default('')}</th>
	     	<th>${one.status_name?default('')} ${one.status}</th>
	     	<td>
	     	<#if one.status = 1><a onclick="banner_offline(${one.id?default('')})">下架</a><#else><a onclick="banner_online(${one.id?default('')})">上线</a></#if>
	     	</td>
	     </tr>
	     </#list>
	     </tbody>
	</table>
</div>
</body>
<script src="${base}/js/jquery-2.1.4.min.js" type="text/javascript"></script>
<script src="${base}/layui/layui.all.js"></script>
<script src="${base}/js/jquery.form.js"></script>
<script type="text/javascript">
function banner_online(id){
	$.post("${base}/black_list/banner_online",
	   		{"id":id},function(data){ 
	   			layer.msg(data);
	   			window.location.reload();
	   		}
	    );

}

function banner_offline(id){
	$.post("${base}/black_list/banner_offline",
	   		{"id":id},function(data){ 
	   			layer.msg(data);
	   			window.location.reload();
	   		}
	    );

}
</script>
</html>